﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Diagnostics;

namespace WDA.Config.Database
{
	internal sealed class Host : IHost
	{
		#region Members
		private readonly int _id;
		private readonly string _name;
		private readonly string _baseUri;
		private readonly string _baseMonitorUri;
		private readonly string _managementUri;
		private ReadOnlyCollection<IService> _services;
		#endregion

		internal Host(int id, string name, string baseUri, string baseMonitorUri, string managementUri)
		{
			_id = id;
			_name = name;
			_baseUri = baseUri;
			_baseMonitorUri = baseMonitorUri;
			_managementUri = managementUri;
		}		
		internal int Id
		{
         [DebuggerStepThrough]
			get { return _id; }
		}

		internal void SetServices(List<IService> services)
		{
			_services = services.AsReadOnly();
		}

		#region IHost Members
		public string Name
		{
         [DebuggerStepThrough]
			get { return _name; }
		}

		public string BaseUri
		{
         [DebuggerStepThrough]
			get { return _baseUri; }
		}

		public string BaseMonitorUri
		{
         [DebuggerStepThrough]
			get { return _baseMonitorUri; }
		}

		public string ManagementUri
		{
			[DebuggerStepThrough]
			get { return _managementUri; }
		}

		public IEnumerable<IService> Services
		{
         [DebuggerStepThrough]
			get { return _services; }			
		}		
		#endregion
	}
}
